package sign_in.loginsystem.mapper;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import sign_in.loginsystem.model.entity.Menu;
import sign_in.loginsystem.model.entity.Role;
import sign_in.loginsystem.model.entity.User;

import java.util.ArrayList;

@Mapper
public interface RoleAndPemMapper {

    Role searchUserRole(User user);

    ArrayList<Integer> searchRolePemId(Role role);

    ArrayList<Menu> searchRolePem(@Param("list")ArrayList<Integer> PemId);

    ArrayList<Role> allRole();

    Integer roleNum();

    Integer menuNum();

    boolean createRole(Role role);

    boolean insertRoleAndMenu(Role role);

    boolean delRole(Role role);

    boolean editRole(Role role);

    ArrayList<Menu> allMenu();

    ArrayList<Integer>  numberOfRoles(ArrayList<Role> roles);

    boolean delMenu(Menu menu);

    boolean editMenu(Menu menu);

    boolean createMenu(Menu menu);

}
